{%include file="header.html" %} 
        <div id="page" style="display: block;">
              {%include file="top.html" %} 
			{%include file="shadow.html" %} 
            <div class="wfx">
                <form class="Form StaticForm" id="form1" method="post" action=""
                id="BoardEdit">
                    <input type="hidden" value="802168" name="board_id" id="id_board_id">
                    <h3>
                        {%if $g_show.item.id%}编辑专辑{%else%}创建新专辑{%/if%} 
                    </h3>
                    <ul>
                        <li>
                            <label for="id_title">
                                标题
                            </label>
                            <div class="Right">
                                <input type="text" name="title" value="{%$g_show.item.title%}" >
                            </div>
                        </li>
                        <li>
                            <label for="id_description">
                                描述
                            </label>
                            <div class="Right">
                                <textarea name="desc" cols="40" rows="3" id="desc">{%$g_show.item.desc%}</textarea>
                            </div>
                        </li>
                        <li>
                            <label>
                                分类
                            </label>
                            <div class="Right">
                                <input type="hidden" value="{%$g_show.item.id%}" id="id" name="id">
                                <div class="BoardListOverlay">
                                </div>
								<input type="hidden" name="topic_id" id="topic_id" value="{%$g_show.item.mblog_show_type%}|{%$g_show.item.mblog_topic_id%}">
								<input type="hidden" name="mblog_topic" id="mblog_topic"  value="{%$g_show.item.mblog_topic%}">
                                <div class="BoardSelector BoardPicker CategoryPicker">
                                    <div class="current">
                                        <span class="CurrentBoard">
                                            {%if $g_show.item.mblog_topic%}{%$g_show.item.mblog_topic%}{%else%}选择分类{%/if%}
                                        </span>
                                        <span class="DownArrow">
                                        </span>
                                    </div>
                                    <div class="BoardList">
                                        <div class="BoardListBody">
                                            <ul>
											{%section name=count loop=$g_show.type_list%}
                                                <li class="BoardCategory" data="{%$g_show.type_list[count].show_type%}|{%$g_show.type_list[count].id%}">
                                                    <span>{%$g_show.type_list[count].topic%}</span>
                                                </li>
												{%/section%}
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </li>
						{%if $g_show.item.id%}
                        <li class="Delete">
                            <label>
                                删除
                            </label>
                            <a class="btn-del btn btn18 wbtn del_album" value="{%$g_show.item.id%}">
                                <strong>
                                    删除专辑
                                </strong>
                                <span>
                                </span>
                            </a>
                        </li>
						{%/if%}
                    </ul>
                    <div class="Submit">
                        <a class="editpage_submit btn btn24 rbtn" id="creat_btn" href="javascript:void(0);">
                            <strong>
                                保存设置
                            </strong>
                            <span>
                            </span>
                        </a>
                    </div>
                </form>
            </div>
        </div>
        <div class="clear">
        </div>
        <div class="overlay" style="display: none;" id="page_overlay">
        </div>
      
        {%include file="footer_js.html" %} 
	<script>
$(document).ready(function(){
	$(".BoardSelector").find(".current").live("click",function(e){
			$(".BoardList").toggle();
	});
	$(".BoardCategory").bind("click",function(e){
		var type_id = $(this).attr("data");
		$("#topic_id").val(type_id);
		var mblog_topic = $(this).find("span").html();
		$(".CurrentBoard").html(mblog_topic);
		$("#mblog_topic").val(mblog_topic);
		 $(".BoardList").hide();
	});

	
	$("#creat_btn").bind("click",function(e){
		$.ajax({
			type:"post",
			url:"/interface/album/json_user_add_album.php",
			data:$("#form1").serialize(),
			dataType:"text",	
			complete:function(xhr,statusText){
				if(statusText == "success"){
					var result = eval("("+xhr.responseText+")");
					if(result.error == 1)
					{
						YOUXIXIU.MAIN.Tips.Show(result.errmsg);
					}
					else
					{
						YOUXIXIU.MAIN.Tips.Show(result.errmsg);

						location.href="/user/my_album_detail.php?id="+result.data.id;
					}
					
				}else{
					alert("网络传输失败")
				}
			}
		});


	});
	$(".del_album").bind("click",function(e){
		
		if(confirm("是否确定删除？！"))
		{
				var album_id = $(this).attr("value");

				$.ajax({
				type:"post",
				url:"/interface/album/json_user_add_album.php?type=del&id="+album_id,
				dataType:"text",	
				complete:function(xhr,statusText){
					if(statusText == "success"){
						var result = eval("("+xhr.responseText+")");
						if(result.error == 1)
						{
							YOUXIXIU.MAIN.Tips.Show(result.errmsg);
						}
						else
						{
							YOUXIXIU.MAIN.Tips.Show(result.errmsg);

							location.href="/user/my_album.php";
						}
						
					}else{
						alert("网络传输失败")
					}
				}
			});

		}
		
	});


});


	



	</script>


		  {%include file="footer.html" %} 